﻿using System.Collections.Generic;

namespace dPet.Application.Services
{
	using dPet.Application.DataObjects;
	using dPet.Infrastructure.Logging;

	public interface IServiceManagementService
	{
		#region Category

		/// <summary>
		/// 添加服务类别
		/// </summary>
		MessagedResult<bool> AddServiceCategory(ServiceCategoryDto categoryDto, IOperator @operator);

		/// <summary>
		/// 更新服务类别
		/// </summary>
		MessagedResult<bool> UpdateServiceCategory(string categoryId, ServiceCategoryDto categoryDto, IOperator @operator);

		/// <summary>
		/// 获取服务类别列表
		/// </summary>
		IEnumerable<ServiceCategoryDto> GetServiceCategories(string hospitalId);

		/// <summary>
		/// 获取服务类别
		/// </summary>
		ServiceCategoryDto GetServiceCategory(string id);

		#endregion

		#region SKU Property

		/// <summary>
		/// 添加服务SKU属性
		/// </summary>
		MessagedResult<bool> AddServiceSKUProperty(ServiceSKUPropertyDto skuPropertyDto, IOperator @operator);

		/// <summary>
		/// 更新服务SKU属性
		/// </summary>
		MessagedResult<bool> UpdateServiceSKUProperty(string propertyId, ServiceSKUPropertyDto skuPropertyDto, IOperator @operator);

		/// <summary>
		/// 获取服务SKU属性列表
		/// </summary>
		IEnumerable<ServiceSKUPropertyDto> GetServiceSKUProperties(string hospitalId, bool loadCategory);

		/// <summary>
		/// 根据类别获取服务SKU属性列表
		/// </summary>
		IEnumerable<ServiceSKUPropertyDto> GetServiceSKUPropertiesByCategory(string categoryId);

		/// <summary>
		/// 获取服务SKU属性
		/// </summary>
		ServiceSKUPropertyDto GetServiceSKUProperty(string id, bool loadCategory, bool loadValues);

		/// <summary>
		/// 保存服务SKU属性值
		/// </summary>
		MessagedResult<bool> SaveServiceSKUPropertyValue(string skuPropertyId, ServiceSKUPropertyValueDto skuPropertyValueDto, IOperator @operator);

		#endregion

		#region Service Item

		/// <summary>
		/// 添加服务项
		/// </summary>
		MessagedResult<bool> AddServiceItem(ServiceItemDto serviceItemDto, IOperator @operator);

		/// <summary>
		/// 更新服务项
		/// </summary>
		MessagedResult<bool> UpdateServiceItem(string itemId, ServiceItemDto serviceItemDto, IOperator @operator);

		/// <summary>
		/// 获取服务项列表
		/// </summary>
		IEnumerable<ServiceItemDto> GetServiceItems(string hospitalId, bool loadCategory, bool loadSKUProperties);

		/// <summary>
		/// 根据类别获取服务项列表
		/// </summary>
		IEnumerable<ServiceItemDto> GetServiceItemsByCategory(string categoryId);

		/// <summary>
		/// 获取服务项
		/// </summary>
		ServiceItemDto GetServiceItem(string id, bool loadCategory, bool loadSKUProperties, bool loadSKUList);

		#endregion

		#region Service Item Properties

		/// <summary>
		/// 为服务项添加SKU属性
		/// </summary>
		MessagedResult<bool> AddSKUPropertyToServiceItem(string serviceItemId, string skuPropertyId, IOperator @operator);

		/// <summary>
		/// 为服务项移除SKU属性
		/// </summary>
		MessagedResult<bool> RemoveSKUPropertyFromServiceItem(string serviceItemId, string skuPropertyId, IOperator @operator);

		#endregion

		#region Service Item SKU

		IEnumerable<ServiceItemSKUDto> GetServiceItemSKUListForMembership(string serviceItemId, MembershipLevelDto membershipLevelDto);

		/// <summary>
		/// 为服务项重新生成SKU
		/// </summary>
		MessagedResult<bool> RegenerateSKUForServiceItem(string serviceItemId, IOperator @operator);

		/// <summary>
		/// 为服务项移除一条SKU
		/// </summary>
		MessagedResult<bool> RemoveSKUFromServiceItem(string serviceItemSKUId, IOperator @operator);

		/// <summary>
		/// 更新服务项SKU
		/// </summary>
		MessagedResult<bool> UpdateServiceItemSKU(string serviceItemSKUId, ServiceItemSKUDto skuDto, IOperator @operator);

		#endregion
	}
}
